<?php

namespace app\order\controller;

use app\api\logic\TestLogic;
use app\common\controller\PCBase;
use app\BaseController;
use app\order\logic\OrderCheckDisputeLogic;
use think\facade\Db;
use Throwable;
use app\common\library\Upload;

class OrderCheckDispute extends PCBase
{


    public function initialize(): void
    {
        parent::initialize();
    }

    

    /**
     * index
     * @throws Throwable
     */
    public function index()
    {
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->index($params);
    }

    
    /**
     * 添加
     * @throws Throwable
     */
    public function add()
    {
        $post = $this->request->post();
        $AdvaccountlogLogic = new OrderCheckDisputeLogic();
        $result = $AdvaccountlogLogic->add($post);
        return $result;
    }

    /**
     * 回显
     * @throws Throwable
     */
    public function find($id = null)
    {
        $post = $this->request->post();
        $id = $post['id'] ?? 0;
        $AdvaccountlogLogic = new OrderCheckDisputeLogic();
        $result = $AdvaccountlogLogic->find($id);
        return $result;
    }
    /**
     * 编辑
     * @throws Throwable
     */
    public function edit()
    {
        $post = $this->request->post();
        $AdvaccountlogLogic = new OrderCheckDisputeLogic();
        $result = $AdvaccountlogLogic->edit($post);
        return $result;
    }

    /**
     * export
     * @throws Throwable
     */
    public function export()
    {
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->export($params);
    }

    /**
     * @desc   import
     * @author zhagnheng
     * @date   2024-07-27
     */
    public function import(){
        $file       = $this->request->file('file');
        $res        = (new Upload($file))->upload(null, $this->getAdminId()); 
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->import($res['url']);
    }

    //CheckDispute
    public function CheckDispute(){
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->CheckDispute($params);
    }
    //CheckDispute
    public function exportCheckDispute(){
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->exportCheckDispute($params);
    }
    //ConversaList
    public function ConversaList(){
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->ConversaList($params);
    }

    
    /**
     * StoreDisputeRate店铺争议率
     * @throws Throwable
     */
    public function StoreDisputeRate()
    {
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->StoreDisputeRate($params);
    }


    
    /**
     * index
     * @throws Throwable
     */
    public function unmatcheds()
    {
        $params     = $this->request->post();
        $OrderCheckDisputeLogic = new OrderCheckDisputeLogic();
        return $OrderCheckDisputeLogic->unmatcheds($params);
    }

}
